import App from './App'
import fui from './common/fui-app';
import http from './components/firstui/fui-request';
import * as Pinia from 'pinia';
import fuiConfig from './components/firstui/fui-config';

//组件全局配置，$fui 为约定值不可修改
uni.$fui = fuiConfig;

//响应拦截
http.interceptors.response.use(response => {
	//TODO
	return response;
});


// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	app.use(Pinia.createPinia());
	app.config.globalProperties.fui = fui;
	app.config.globalProperties.http = http;
	return {
		app,
		Pinia
	}
}
// #endif